package com.atguigu.string;

import org.junit.Test;

public class StringMethodTest {
    @Test
    public void test1(){
        String s1="HelloWorld";
        System.out.println(s1.length());//10
        System.out.println(s1.charAt(4));//o
        System.out.println(s1.isEmpty());//false
        String s2=s1.toLowerCase();
        System.out.println(s1);//HelloWorld
        System.out.println(s2); //helloworld,改成小写后的字符串

        String s3="        hel l  o world   ";
        System.out.println(s3.trim()); //去除首尾空格使用
        System.out.println(s3);

        System.out.println(s1.substring(2));//lloWorld
        System.out.println(s1.substring(1,3));//el
    }
}
